import request from '@/utils/request'

// 查询理论练习列表
export function listExercise(query) {
    return request({
        url: '/ex/exercise/list',
        method: 'get',
        params: query
    })
}

// 查询理论练习详细
export function getExercise(id) {
    return request({
        url: '/ex/exercise/' + id,
        method: 'get'
    })
}

// 新增理论练习
export function addExercise(data) {
    return request({
        url: '/ex/exercise',
        method: 'post',
        data: data
    })
}
export function createExercise(data) {
    return request({
        url: '/ex/exercise/create',
        method: 'post',
        data: data
    })
}

// 修改理论练习
export function updateExercise(data) {
    return request({
        url: '/ex/exercise',
        method: 'put',
        data: data
    })
}


// 提交
export function submitExercise(id,timer,data) {
    return request({
        url: `/ex/exercise/submit/${id}/${timer}`,
        method: 'put',
        data: data
    })
}

// 删除理论练习
export function delExercise(id) {
    return request({
        url: '/ex/exercise/' + id,
        method: 'delete'
    })
}
